package io.github.talelin.sleeve.controller.v1;

import io.github.talelin.sleeve.entity.Banner;
import io.github.talelin.sleeve.mapper.BannerMapper;
import io.github.talelin.sleeve.service.TestSleeveService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("v1/test")
public class TestSleeveController {

    @Resource
    private TestSleeveService testSleeveService;
    @Resource
    private BannerMapper bannerMapper;

    @GetMapping("/banner")
    public List<Banner> test1(){
        List<Banner> bannerDos  = testSleeveService.getBanners();
        return bannerDos;
    }
    @GetMapping("/test2")
    public List<Banner> test2(){
        bannerMapper.selectList(null);
        List<Banner> bannerDos  = testSleeveService.getBanners();
        return bannerDos;
    }
}
